<template>
  <div class="dad">
    父组件:{{ car.name }}++{{ car.price }}
    <Son/>
  </div>
</template>

<script>
import Son from './components/Son.vue';
import { provide, reactive,ref } from 'vue';

export default {
  name:'App',
  components:{Son},
  setup(){
    let name = ref('张扬')
    let car = reactive({name:'宝马730',price:'40w'})
    provide('name',name)
    provide('car',car)
    return {
      car
    }
  }
}
</script>

<style>
  .dad{
    padding:40px;
    background-color: red;
  }
</style>